package com.wandian.weather.bean;

import android.text.TextUtils;

import com.chad.library.adapter.base.entity.MultiItemEntity;

import java.io.Serializable;
import java.util.List;


public class ZixunListInfo implements MultiItemEntity, Serializable {
    /**
     * id : 25447
     * title : 植村秀热门色号合辑，包里必备一支！
     * picture : http://img.cnys.com/upload9/thumb/2017/09-21/0-MrmsPI.jpg
     * picture2 :
     * picture3 : []
     * bigpicture :
     * listtype : 1
     * is_ad : 0
     * ad_url :
     */

    public static final int ZIXUN_ITEM_TYPE_ONE_PICTURE = 0;
    public static final int ZIXUN_ITEM_TYPE_NO_PICTURE = 1;
    public static final int ZIXUN_ITEM_TYPE_THREE_PICTURE = 2;
    public static final int ZIXUN_ITEM_TYPE_AD = 3;
    public static final int ZIXUN_ITEM_TYPE_LOAD_MORE = 4;
    public static final int ZIXUN_ITEM_TYPE_AD_LEFT = 5;

    private String id;
    private String title;
    private String picture;
    private String picture2;
    private String bigpicture;
    private String listtype = "1";
    private String is_ad = "0";
    private String ad_url;
    private String source;
    private String showtime;
    /**
     * category : 1
     * longtitle : 测试数据2短标题
     * videopath : http://pic.new.tianqistatic.com/content/20180717/7cdb246ebf758e578d615145f1b6b14a.mp4
     * digest : 测试数据2 简介
     * goodnum : 0
     */

    private String category;
    private String longtitle;
    private String videopath;
    private String digest;
    private String goodnum;
    private String author_img;
    private String video_length;
    private String adType;

    public String getShowtime() {
        return showtime;
    }

    public void setShowtime(String showtime) {
        this.showtime = showtime;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    private List<String> picture3;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public String getPicture2() {
        return picture2;
    }

    public void setPicture2(String picture2) {
        this.picture2 = picture2;
    }

    public String getBigpicture() {
        return bigpicture;
    }

    public void setBigpicture(String bigpicture) {
        this.bigpicture = bigpicture;
    }

    public String getListtype() {
        return listtype;
    }

    public void setListtype(String listtype) {
        this.listtype = listtype;
    }

    public String getIs_ad() {
        return is_ad;
    }

    public void setIs_ad(String is_ad) {
        this.is_ad = is_ad;
    }

    public String getAd_url() {
        return ad_url;
    }

    public void setAd_url(String ad_url) {
        this.ad_url = ad_url;
    }

    public String getVideo_length() {
        return video_length;
    }

    public void setVideo_length(String video_length) {
        this.video_length = video_length;
    }

    public String getAdType() {
        return adType;
    }

    public void setAdType(String adType) {
        this.adType = adType;
    }

    @Override
    public int getItemType() {
        if(TextUtils.equals(is_ad, "0")){
            int itemtype = 0;
            try {
                itemtype = Integer.parseInt(listtype);
                if(itemtype == 0)
                    return ZIXUN_ITEM_TYPE_NO_PICTURE; // 无图
                else if(itemtype == 1)
                    return ZIXUN_ITEM_TYPE_ONE_PICTURE; //一图
                else if(itemtype == 2)
                    return ZIXUN_ITEM_TYPE_THREE_PICTURE; //三图
                else if(itemtype == 99)
                    return ZIXUN_ITEM_TYPE_LOAD_MORE;
                else return ZIXUN_ITEM_TYPE_ONE_PICTURE;
            }catch (Exception e){
                return itemtype;
            }
        }else {
            if(TextUtils.equals(adType, "7")){
                return ZIXUN_ITEM_TYPE_AD_LEFT;
            }
            return ZIXUN_ITEM_TYPE_AD;//is ad
        }
    }

    public List<String> getPicture3() {
        return picture3;
    }

    public void setPicture3(List<String> picture3) {
        this.picture3 = picture3;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getLongtitle() {
        return longtitle;
    }

    public void setLongtitle(String longtitle) {
        this.longtitle = longtitle;
    }

    public String getVideopath() {
        return videopath;
    }

    public void setVideopath(String videopath) {
        this.videopath = videopath;
    }

    public String getDigest() {
        return digest;
    }

    public void setDigest(String digest) {
        this.digest = digest;
    }

    public String getGoodnum() {
        return goodnum;
    }

    public void setGoodnum(String goodnum) {
        this.goodnum = goodnum;
    }

    public String getAuthor_img() {
        return author_img;
    }

    public void setAuthor_img(String author_img) {
        this.author_img = author_img;
    }
}
